﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NDF.DataAccess.Common;
using System.Data;

namespace NDF.Test.DataAccess
{
    [TestClass]
    public class OracleDatabaseTest
    {
        [TestMethod]
        public void TestMethod1()
        {
            Database database = DatabaseFactories.CreateDatabase("OracleContextTest");
            DataTable table = database.ExecuteDataTable("SELECT * FROM dba_tables");
            foreach (DataRow row in table.Rows)
            {
                Console.WriteLine(row["TABLE_NAME"]);
            }
        }

        [TestMethod]
        public void TestMethod2()
        {
            Database database = DatabaseFactories.CreateDatabase("OracleContextTest");
            DataTable table = database.ExecuteDataTable("SELECT * FROM dba_tables WHERE TABLE_NAME LIKE '%' || :name || '%'", "TYPE");
            foreach (DataRow row in table.Rows)
            {
                Console.WriteLine(row["TABLE_NAME"]);
            }
        }
    }
}
